<?php
include_once("config/config.php");
include_once(CLASS_PATH."logic.php");
include_once(CLASS_PATH."Template.php");
require_once(DATA_PATH."table_dao.php");
////////////////////////////////////////////////////////////
$sitehtml = "Feedback.html";
$data = $_GET;
$get_site_value =_GET("site");
$get_type_value =_GET("type");
$get_post_value =_GET("post");
if(empty($get_site_value)||empty($get_type_value)){
	$data = array(
		"site"=> "yahoo,bidders",
		"type"=> "auction"
		);
}
$fjsearch = new logic($data);
$repstr = $fjsearch->Output("feedback","array");
$ispost = empty($get_post_value)?"0":"1";
$repstr = array_merge($repstr,array(
    "_ISPOST"  =>$ispost,
    "_input_keyword"  =>_GET("q"),
    "_input_searchtype"  =>_GET("type")
  ));
$fjsearch = new logic($data);
$template = new Template(false,false);
$template->Out($sitehtml,$repstr);
if($ispost=="1"){
	$Data_feedback = array(
		"Id"		=>	_GET("id"),
		"f_name"	=>	_GET("username"),
		"f_uid"	=>	_GET("userid"),
		"f_email"	=>	_GET("email"),
		"f_keyword"	=>	_GET("q"),
		"f_type"	=>	_GET("type"),
		"f_message"	=>	_GET("message"),
		//"handleFlag"	=>	_GET("id")
		);
  $feed_dao = new table_dao("feedback");
  //$feed_dao->get($Data_feedback);
  //echo "\n";
  $feed_dao->add($Data_feedback);
  //echo "\n";
  //$feed_dao->updata(1,$Data_feedback);
}
?>